1. Field of the Invention
The present invention relates to an image compression and expansion apparatus for recording image data obtained by reducing the number of pixels of an original still image onto a recording medium and later reading the image data from the recording medium and restoring the original image.
2. Description of the Related Art
In the past, as an example of image compression processing in an image compression and expansion apparatus, it has been known to find an average value of a predetermined number of pixel values included in the large number of pixels forming an original image, to generate a single pixel and to record a reduced image comprised of such pixels on to a recording medium. Further, in the image expansion processing in the image compression and expansion apparatus, the reduced image read from the recording medium is subject to interpolation so as to generate an enlarged image of the same number of pixels as the original image.
On the other hand, another image compression and expansion apparatus is known to record DCT coefficients obtained by application of a two dimensional discrete cosine transformation to a reduced image onto a recording medium and applying a two dimensional inverse discrete cosine transformation to the DCT coefficients read from the recording medium to obtain IDCT coefficients. The IDCT coefficients correspond to part of the pixels contained in the pixels of the original image. By applying interpolation to the IDCT coefficients, it is possible to generate an enlarged image of the same number of pixels as the original image.
The enlarged image reproduced by an image compression and expansion apparatus should ideally match the original image, but since part of the information included in the original image is lost at the time of generating the reduced image, normally the original image is not matched and the quality of the image becomes relatively poor.
An object of the present invention is to provide an image compression and expansion apparatus for reproducing an expanded image corresponding to an original image from a reduced image, which can improve the quality of the expanded image.
According to a first aspect of the present invention, there is provided an image compression apparatus comprising a reduced image generating processor, a reduced image area setting processor, a first orthogonal transforming processor, a mode setting processor, a first expanded image generating processor, an evaluation function calculating processor and a mode/displacement-amount selecting processor.
The reduced image generating processor generates, based on original image data arranged in a first matrix comprised of a plurality of pixels, reduced image data arranged in a second matrix comprised of a smaller number of pixels than the first matrix. The reduced image area setting processor sets a reduced image area, which is defined by: a sub-matrix, obtained by displacing the second matrix in a predetermined direction, and contains an objective pixel also contained in the reduced image data. The first orthogonal transforming processor applies orthogonal transformation to the reduced image data of the reduced image area to obtain reduced orthogonal transformation coefficient data. The mode setting processor sets a single pixel arrangement mode included in a plurality of pixel arrangement modes, each of which indicates an arrangement of pixels of a third matrix comprised of a greater number of pixels than the second matrix. The first expanded image generating processor applies inverse orthogonal transformation to the reduced orthogonal transformation coefficient data to obtain expanded image data arranged in a third matrix corresponding to one of the pixel arrangement modes. The evaluation function calculating processor calculates a value of an evaluation function, which corresponds to a difference between the original image data and the expanded image data. The mode/displacement-amount selecting processor selects the pixel arrangement mode and displacement direction and amount of the reduced image area, for every objective pixel, in such a manner that the value of the evaluation function becomes a minimum.
According to a second aspect of the present invention, there is provided an image expansion apparatus for expanding reduced image data recorded in a recording medium by the image compression apparatus, described above as the first aspect, which further comprises a recording processor that records the reduced image data, a first parameter which is selected by the mode/displacement-amount selecting processor and indicates the displacement direction and amount, and a second parameter which indicates the pixel arrangement modes, in a recording medium. The image expansion apparatus further comprises a data reading processor, a reduced image area selecting processor, a second orthogonal transforming processor and a second expanded image generating processor.
The data reading processor reads the first and second parameters and the reduced image data from the recording medium. The reduced image area selecting processor selects a reduced image area based on the first parameter, for every objective pixel included in the reduced image data. The second orthogonal transforming processor applies the orthogonal transformation to the reduced image data of the reduced image area selected by the reduced image area selecting processor, for every objective pixel, to obtain reduced orthogonal transformation coefficient data. The second expanded image generating processor applies inverse orthogonal transformation to the reduced orthogonal transformation coefficient data to obtain expanded image data arranged in a third matrix corresponding to a pixel arrangement mode indicated by the second parameter.
According to a third aspect of the present invention, there is provided an image compression apparatus comprising a reduced image generating processor, a reduced image area setting processor, a first orthogonal transforming processor, a mode setting processor, a first expanded image generating processor, a contrast coefficient calculating processor, a contrast adjusting processor, an error evaluation function calculating processor and a mode/displacement-amount selecting processor.
The reduced image generating processor generates, based on original image data arranged in a first matrix comprised of a plurality of pixels, reduced image data arranged in a second matrix comprised of a smaller number of pixels than the first matrix. The reduced image area setting processor sets a reduced image area, which is defined by a sub-matrix, obtained by displacing the second matrix in a predetermined direction, and contains an objective pixel also contained in the reduced image data. The first orthogonal transforming processor applies orthogonal transformation to the reduced image data to obtain reduced orthogonal transformation coefficient data. The mode setting processor sets a single pixel arrangement mode included in a plurality of pixel arrangement modes, each of which indicates an arrangement of pixels of a third matrix comprised of a greater number of pixels than the second matrix. The first expanded image generating processor applies inverse orthogonal transformation to the reduced orthogonal transformation coefficient data to obtain expanded image data arranged in a third matrix corresponding to one of the pixel arrangement modes. The contrast coefficient calculating processor obtains a contrast coefficient in such a manner that a contrast of the expanded image data becomes close to a contrast of the original image data by applying the contrast coefficient to the expanded image data. The contrast adjusting processor applies the contrast coefficient to the expanded image data to modify the expanded image data whereby modified expanded image data is obtained. The error evaluation function calculating processor calculates a value of an evaluation function, which corresponds to a difference between the original image data and the modified expanded image data. The mode/displacement-amount selecting processor selects the pixel arrangement mode and displacement direction and amount of the reduced image area, for every objective pixel, in such a manner that the value of the evaluation function becomes a minimum.
According to a fourth aspect of the present invention, there is provided an image expansion apparatus for expanding reduced image data recorded in a recording medium by the image compression apparatus, described above as the third aspect, which further comprises a recording processor that records the reduced image data, the contrast coefficient, and a first parameter which is selected by the mode/displacement-amount selecting processor and indicates the displacement direction and amount, and a second parameter which indicates the pixel arrangement modes, in a recording medium. The image expansion apparatus further comprises a data reading processor, a reduced image area selecting processor, a second orthogonal transforming processor, a second expanded image generating processor and a contrast adjusting processor.
The data reading processor reads the first and second parameters, the contrast coefficient and the reduced image data from the recording medium. The reduced image area selecting processor selects a reduced image area based on the first parameter, for every objective pixel included in the reduced image data. The second orthogonal transforming processor applies the orthogonal transformation to the reduced image data of the reduced image area selected by the reduced image area selecting processor, for every objective pixel, to obtain reduced orthogonal transformation coefficient data. The second expanded image generating processor applies inverse orthogonal transformation to the reduced orthogonal transformation coefficient data to obtain expanded image data arranged in a third matrix corresponding to a pixel arrangement mode indicated by the second parameter. The contrast adjusting processor applies the contrast coefficient to the expanded image data to modify the expanded image data whereby modified expanded image data is obtained.